#include <iostream>
#include <vector>

using namespace std;


int n;

int main() {
    cin >> n;

    int arr[30][30] = { 1 };
    for (int i = 0; i < 30; i++)
    {
        for (int j = 0; j < 30; j++)
            arr[i][j] = 1;
    }
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j <= i; j++)
        {
            if (j == 0 || (i == j))
            {
                arr[i][j] = 1;
                printf("%5d", arr[i][j]);
            }
            else if (i >= 2)
            {
                int ret = arr[i - 1][j] + arr[i - 1][j - 1];
                arr[i][j] = ret;
                printf("%5d", arr[i][j]);
            }
        }
        cout << endl;
    }

}